package com.flymobi.mshop.adapter;

import android.R.integer;
import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.Gallery;
import android.widget.ImageView;

import com.flymobi.mshop.R;

public class MyGallery extends BaseAdapter {
	private Context mContext;
	private integer[] mImageIds;
	private ImageView[] mImages;
	private Integer[] mImage = { R.drawable.p1, R.drawable.p1, R.drawable.p1,
			R.drawable.p1,

			R.drawable.p1,

			R.drawable.p1,

			R.drawable.p1,

			R.drawable.p1,

	};

	public MyGallery(Context context) {
		this.mContext = context;

	}

	@Override
	public int getCount() {
		// TODO Auto-generated method stub
		return mImage.length;
	}

	@Override
	public Object getItem(int position) {
		// TODO Auto-generated method stub
		return position;
	}

	@Override
	public long getItemId(int position) {
		// TODO Auto-generated method stub
		return position;
	}

	@Override
	public View getView(int position, View convertView, ViewGroup parent) {
		// TODO Auto-generated method stub
		ImageView i = new ImageView(mContext);
		i.setImageResource(mImage[position]);
		i.setScaleType(ImageView.ScaleType.FIT_XY);
		i.setBackgroundResource(R.drawable.background_corners);
		i.setLayoutParams(new Gallery.LayoutParams(88, 88));
		return i;
	}

}
